Skip to content

fix: preserve JSON responses to streaming requests - #12

Merged
jkyberneees merged 1 commit into
mainfrom
fix/streamed-json-response
Oct 2, 2026
Merged

jkyberneees merged 1 commit into
mainfrom
fix/streamed-json-response

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

A successful JSON response to a streaming request was discarded, followed by another generation. This could lose assistant progress notes and tool calls and duplicate token usage. Consume the original response with the existing format parser and body cap, then keep the learned buffered mode for future requests. Malformed or unreadable responses return their error without silently replacing the generation.

Validation: full SDK race suite and golangci-lint pass. OpenAI Chat Completions and Responses regressions verify one request per generation, preserved notes/reasoning/tool calls/usage/signatures, subsequent buffered requests, malformed JSON, read failures and the 50 MiB body bound. The new fallback branches have complete statement coverage.

This patch will be tagged v0.6.1 after CI and squash merge; odek v2.29.7 consumes it for the partial-turn rendering fix.

@jkyberneees
jkyberneees merged commit b92ebb0 into main Oct 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant